[tools, extras] morfessor installation script#2299
Conversation
tools/extras/install_morfessor.sh
Outdated
| echo "#### installing morfessor" | ||
| dirname=morfessor | ||
| if [ ! -d ./$dirname ]; then | ||
| mkdir -p ./$dirname |
There was a problem hiding this comment.
could you please change the tabs to spaces (each tab = two spaces)?
There was a problem hiding this comment.
applied retab with size 2
tools/install_morfessor.sh
Outdated
| @@ -0,0 +1 @@ | |||
| extras/install_morfessor.sh No newline at end of file | |||
There was a problem hiding this comment.
I think you don't have to add this symlink (that is done only for historical reasons for some packages)
There was a problem hiding this comment.
okay got it. I deleted the symlink
tools/extras/install_morfessor.sh
Outdated
| fi | ||
|
|
||
| # local installation | ||
| site_packages_dir=$(python -m site --user-site | grep -oE "lib.*") |
There was a problem hiding this comment.
typically we try to not to install the packages system-wise (user-wise) -- we keep the libs in kaldi/tools/ and just set up the shell variables in env.sh (PYTHONPATH). Otherwise, you could just use pip install morfessor.
Also, in that case, the uninstallation is not needed -- you just delete the directory.
There was a problem hiding this comment.
@jtrmal
That line is not intended to install morfessor in user-wise way.
It is just to grep the name of site-package name and use the name for PYTHONPATH variable before installation started,
otherwise, sometimes installation process could get an error.
Anyway after installation process, the morfessor libs will be located inside kaldi/tools/
|
@jtrmal, please merge when you think it's OK. |
|
Yep, I will get to this tmrw, I'm still not fully comfortable with my
understanding how the script works.
Y.
…On Sat, Mar 24, 2018, 18:57 Daniel Povey ***@***.***> wrote:
@jtrmal <https://github.com/jtrmal>, please merge when you think it's OK.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2299 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AKisX7SPJ0Nuw2EjIsBF-6xMdOk0oY5Mks5ths9EgaJpZM4S2Y5E>
.
|
tools/extras/install_morfessor.sh
Outdated
| mkdir -p ./$dirname | ||
| git clone https://github.com/aalto-speech/morfessor.git morfessor || | ||
| { | ||
| if [ $? -ne 0 ]; then |
There was a problem hiding this comment.
this is confusing -- why you are testing the return code if you have the guarantee done by ||
There was a problem hiding this comment.
it should be removed
tools/extras/install_morfessor.sh
Outdated
| wd=`pwd` | ||
| wd=`readlink -f $wd || pwd` | ||
| export MORFESSOR="$wd/morfessor" | ||
| export PYTHONPATH="${PYTHONPATH:-}:$MORFESSOR/${site_packages_dir}" |
There was a problem hiding this comment.
I still think this is too complex for no clear reason (reason clear to me) -- you could just install into $MORFESSOR/local/ (or whatever) and this would greatly simplify the script.
tools/extras/install_morfessor.sh
Outdated
|
|
||
| echo >&2 "installation of MORFESSOR finished successfully" | ||
| echo >&2 "please source tools/env.sh in your path.sh to enable it" | ||
| echo >&2 'when uninstall it, try: sudo rm $(cat ./morfessor/files.txt)' |
There was a problem hiding this comment.
and when uninstalling -- you should delete the whole $MORFESSOR fir (and sudo shouldn't be needed to be used?)
There was a problem hiding this comment.
It was intended to inform where exist the real files. Will be removed either
|
Morfessor author here. We normally recommend installing through pip or conda, but in this case there is a much simpler way:
Running setup.py has no benefit here in my opinion. Uninstalling is as simple as removing the repo (and cleaning up the variables if so desired) |
|
Thanks, Peter!
y.
…On Mon, Mar 26, 2018 at 11:03 AM, Peter Smit ***@***.***> wrote:
Morfessor author here. We normally recommend installing through pip or
conda, but in this case there is a much simpler way:
- Clone the github
- Set PYTHONPATH to include the repo
- Set PATH to include the scripts directory
Running setup.py has no benefit here in my opinion.
Uninstalling is as simple as removing the repo (and cleaning up the
variables if so desired)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2299 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AKisXx8HR1DWmrjcaKnMTTb4I8KVW5WHks5tiQMtgaJpZM4S2Y5E>
.
|
|
One issue, I noticed that the scripts in scripts/ are actually not having the executable bit set when cloning, I can fix that upstream (in a couple hours) |
|
Script have executable bit set now: aalto-speech/morfessor@6c5ad6d Changing the gist of the script to: should be enough. |
|
I just tested this script and it works for me (Ubuntu 16.04) |
|
Thanks to both of you! Merging. |
* added install_morfessor.sh and its symbolic link * deleted symbolic link * retab with size 2 * simplified installation process acc. to psmit's advice
* added install_morfessor.sh and its symbolic link * deleted symbolic link * retab with size 2 * simplified installation process acc. to psmit's advice
added install_morfessor.sh and its symbolic link